
import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.Test;


public class BottleTest {
	
	Bottle aBottle;

	@Before
	public void setUp() throws Exception {
		aBottle = new Bottle("Cola", 12);
	}
	
	@Test
	public void initiaValues() {
		String label = aBottle.getLabel();
		assertTrue(label.equals("Cola"));
		
		int currentCapacity = aBottle.getCapacity();
		assertTrue(currentCapacity == 12);
		
		int currentVolume = aBottle.getCurrentVolume();
		assertTrue(currentVolume == 0);
	}
	
	@Test
	public void initialFill() {
		aBottle.refill(10);
		assertTrue(aBottle.getCurrentVolume() == 10);
		assertTrue(aBottle.getCapacity() == 12);
	}
	
	@Test
	public void fillToMaximum() {
		aBottle.refill(12);
		
		int currentVolume = aBottle.getCurrentVolume();
		assertTrue(currentVolume == 12);
		
		int currentCapacity = aBottle.getCapacity();
		assertTrue(currentCapacity == 12);
	}
	
	@Test
	public void pourRegular() {
		aBottle.refill(12);
		int currentVolume = aBottle.getCurrentVolume();
		
		assertTrue(currentVolume == 12);
		
		aBottle.pour(5);
		currentVolume = aBottle.getCurrentVolume();
		
		assertTrue(currentVolume == 12 - 5);
		assertTrue(aBottle.getCapacity() == 12);
		
		aBottle.pour(2);
		currentVolume = aBottle.getCurrentVolume();
		
		assertTrue(currentVolume == 12 - 5  - 2);
		assertTrue(aBottle.getCapacity() == 12);

	}
}
